home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 18
/
Mac Magazin and MacEasy Magazine CD - Issue 18.iso
/
Utilities
/
FileIndexer1.2
/
FileIndexer 1.2.doc
< prev
next >
Wrap
Text File
|
1996-01-11
|
6KB
|
135 lines
FileIndexer 1.2
---------------
I really miss OnLocation. (It doesn't run reliably under system 7.5).
This is my simplistic attempt to knock up some of the key functionality I'm looking for.
In a multi-user environment, where you have budget for a server, I recommend
AppleSearch for indexing your documents. I wanted to have a way to quickly retrieve
a list of documents on a mounted disk that contain a given word.
FileIndexer trades memory for speed. It builds a sorted list of unique words
(not case sensitive), and then keeps a list of the files that contain each word.
This list of lists is kept in memory. This makes it VERY fast to do the binary search.
You can save the index to a file and load it reasonably quickly.
Run FileIndexer, choose Index folder, and select the top folder in a tree of
text files to be indexed. Claris XTND can be used (if available) to read documents.
You need to turn it on in the preferences dialog to use it. Note that some documents,
in my experience, will hang XTND. (I have no control over this). If the beach ball
cursor times out and stops, you are probably stuck. The offending document name
is left displayed in the status field.
When done, type a single word into the find field and press return. A list of all
the files that contain that word will be displayed. In brackets you'll see the number
of times the word is found in that file. Also shown is the modification date of
the file and then the full path to the file.
Double-click on the file to open the first 32k of it in a text window. You can choose
to view the document in it's original app or the app of your choice.
From the text window you can use Find or Find again (command-G) to locate the word
you searched for.
I built a PowerPC native version but it was slower! Probably due to my heavy use
of the non-native file manager.
Limitations
-----------
o Only searches for one word at a time.
o Can't currently index read only volumes.
To Do
-----
o Could be AppleScriptable with almost no work.
o Index the "sound" of words (use soundex etc).
o Move the in memory list to a disk based database!
o Handle multiple words with AND and OR.
o Able to exclude certain folders containing a given string.
o Auto find the searched for word when opening the document.
o Very slow when closing a document, need fast alloc/free for many small objects.
Tools
-----
o Metrowerks Codewarrior 7
o MacApp 3.3
o ObjectMaster
History (DD/MM/YY)
-------
22/12/95 Turned off qTheDebugger & qInspector
27/12/95 Ditched Insert() when reading files. Load speed 21s down to 3s!
27/12/95 Sped up indexing thanks to Metrowerks code profiler.
Release of version 1.0
28/12/95 Started on 1.1
Indexing done in a cohandler so time is given to other apps.
It's a bit slower but is nicer to other apps and allows context switches etc.
Plays a sound when indexing is done.
Reduced RAM overhead of index slightly.
Added a "stop words" feature to exclude common non-interesting words.
Added printing of the document window.
30/12/95 Release of version 1.1
Started on 1.2b1
06/01/96 Fixed write to nil during startup.
Added extra preferences: stem, xtnd, view options. (Doc version to 3).
07/01/96 Added support for Claris XTND to index and display documents.
07/01/96 Shipped 1.2b1 to beta testers, started 1.2b2
Added arrowKeyselection behavior to file list view.
Return and enter now simulate a double click.
Did some work on the printing, headers & footers etc.
Fixed home & end keys by applying patch to UScroller.
Fixed the open in chosen app feature.
Made the document dirty after preference change.
Switched to a Hash index rather than storing words.
- Old test index: 275k, now is 176k
- This produces some bogus hits, will look for better hash functions
Bumped file version as no longer compatable.
08/1/96 - Bumped to 1.2b3
- Found a problem with errors during XTND reads.
- Added user option to not use XTND, Changed file version.
- Switched to MacApp's memory allocator.
- Added a filter to remove TEXT files that shouldn't be indexed,
such as acrobat '.pdf' files. (Others??)
- Reduced index size by removing hit count field. 275k -> 176k -> 154k
- Fixed a bug when indexing a single file.
- Fixed a bug relating to the stop words compare function.
- Removed the show word list functionality (no point with hashing).
- Added a warning if you try to look for more than one word.
09/01/96 - Cleaned up what happens if you close a doc that's indexing.
- Fixed up out of memory failure crash. Now gives message.
- Improved the open in app etc functions that sometimes didn't correctly
find the Finder process.
10/01/96 - Bumped to 1.2b4
- Changed doc version number
- Tried Dave Abraham's better hash function
- Found a bug in AddWord(). (Wrong compare parameter structure used).
- Implemented word stemming
- Shipped a version to Al.
- Improved the about box.
11/01/96 - Bumped to 1.2 final ready for testing and release.
- Release of 1.2 to internet.
(c) 1995,1996 Peter Marks
Suggestions for future enhancements most welcome, but I make no guarantee of support.
This freeware is supplied as is, use at your own risk.
Please contact me for permission to include on commercial collections.
mailto: Peter.Marks@PoBox.com
Acknowledgements
----------------
Thanks for support to:
Gregory Kearney, Allan Herman, Alastair Rankine, Geert Jan Bex, Keith F. Batchelder,
tony stevenson, Federico Cavaglia', Farhad Anklesaria, Dave Abrahams, MetaTheory,
and others!